@extends('backstage.layout.master')
@section('title', '订单详情')
@section('style')
<style>
    .ace-file-input input[type=file]{
        position:static;
    }
    .ace-nav {
        height: 10px;
    }
    #container_id{
        align-content: center;
    }
    .detail-create td{
        background-color: #f5f5f5;
    }
    td span{
        font-size: 18px;
    }
</style>
@stop
@section('script')
    <script>
        function update_config(th){
            var value = $("#"+th).val();
            var data = $("#"+th).attr("data");
            if(value == data) return ;
            console.log(data,value);
            $.ajax({
                url:"/backstage/order/upd-order-config",
                type:"post",
                data:{"id":th,"value":value},
                datatype:'json',
                success:function(re){
                    if(re.state=="M00000"){
                        $("#"+th).attr("data",value);
                        swal(re.message,'','success');
                        return;
                    }
                    swal(re.message,'','warning');
                    $("#"+th).val(data);
                    return;
                },
                error:function(){
                    $("#"+th).val(data);
                    swal('系统繁忙','请稍后重试','warning');return;
                }
            });
        }

    </script>

@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>
        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="/" target="_blank">主页</a>
            </li>
            <li class="active">
                <a href="/backstage/order/order-list">订单列表</a>
            </li>
        </ul><!-- .breadcrumb -->
    </div>
    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        订单
                        <small>
                            <i class="icon-double-angle-right"></i>
                            订单参数配置
                        </small>
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                            @if(isset($result))
                            @foreach($result as $re)
                                <tr>
                                    <td style="width:138px;">{{isset($re->description) ? $re->description : ''}}</td>
                                    <td colspan="5">
                                        <input type="number" style="width:100px;" class="col-xs-10 col-sm-5"
                                        value="{{isset($re->value)? (intval($re->value / 3600)) : ''}}"
                                        onchange="update_config('{{isset($re->id) ? $re->id : ''}}');"
                                        data="{{isset($re->value)? (intval($re->value / 3600)) : ''}}"
                                        id="{{isset($re->id) ? $re->id : ''}}"/>
                                        <span>&nbsp小时</span>
                                    </td>
                                </tr>
                            @endforeach
                            @endif
                            </table>
                        </div>

                        <!-- <div class="clearfix form-actions" >
                            @if(isset($result->order->order_id))
                            <div class="col-md-offset-3 col-md-9">
                                <button id="saveButton" class="btn btn-info" type="button" onclick="refund();">
                                   <i class="icon-ok bigger-110"></i>
                                   修改
                                </button>
                            </div>
                            @endif
                        </div> -->
                    </div>
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
